﻿using CTP.CRM.Core.ExRedis.Options;

namespace CTP.CRM.Core.ExRedis
{
    public static class ExRedisHelper
    {
        private static ExRedisClient _client;

        private static readonly object _lock = new object();

        public static ExRedisClient Client => _client;

        public static void Init(ExRedisSetting setting)
        {
            if (_client != null)
            {
                return;
            }

            lock (_lock)
            {
                if (_client == null)
                {
                    _client = new ExRedisClient(setting);
                }
            }
        }
    }
}
